# 加入购物车
#
# 请求网址:http://182.92.81.159:8080/wx/cart/add
# 请求方法:POST
# 请求头：
# Content-Type: application/json;charset=utf-8
# X-Litemall-Token:TOKEN
# 请求体：
# {"goodsId":1181000,"number":1,"productId":2}

import requests

class add_cartAPI():
    def __init__(self):
        self.add_cart_url="http://192.168.119.138:8080/wx/cart/add"

    # def login(self,test_data):
    #     return requests.post(url=self.url_login,json=test_data)

    def add_cart(self,token,test_data):
        return requests.post(url=self.add_cart_url,
                             headers={"X-Litemall-Token":token},
                             json=test_data)